package com.srit.base.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.srit.base.bean.Page;
import com.srit.base.dao.SqlMapDao;
import com.srit.base.service.BaseService;

/**
 * 基础dao service
 * 
 * @author guan
 * 
 */
public class BaseServiceImpl extends ServiceImpl implements BaseService {
	static Logger log = LoggerFactory.getLogger(BaseServiceImpl.class);
	@Autowired(required = true)
	private SqlMapDao sqlMapDao;

	

	
	@Override
	public void save(Object object) {
		sqlMapDao.save(entityName + ".save", object);
	}

	@Override
	public void update(Object object) {
		sqlMapDao.update(entityName + ".update", object);
	}

	@Override
	public Object getByIntId(Integer id) {
		return sqlMapDao.getById(entityName + ".getById", id);
	}

	@Override
	public void page(Object object, Page page) {
		sqlMapDao.queryForPage(entityName + ".page", page);

	}

	@Override
	public void delete(Object object) {
		sqlMapDao.delete(entityName + ".delete", object);
	}

}
